LibGDX - SpriteBatch's .draw() method requiring float[]
Posted
by
just_a_programmer
on Game Development
See other posts from Game Development
or by just_a_programmer
Published on 2014-06-10T01:40:16Z
Indexed on
2014/06/10
3:45 UTC
Read the original article
Hit count: 262
Please excuse my lack of knowledge with LibGDX, as I have just started learning it. I am going through some simple tutorials, and in one of them, I draw a string onto the screen like so:
// the following code is in the main file in the core project folder:
// this is in the create() method:
private SpriteBatch batch;
batch = new SpriteBatch();
// this is in the render() method:
batch.draw(batch, "Hello world", 200, 200);
I am getting an error saying: The method draw(texture, float[], int, int) in the type SpriteBatch is not applicable for the arguments (SpriteBatch, int, int)
So, LibGDX wants a float array to draw instead of a string?
Thanks in advance.
© Game Development or respective owner